package com.example.myapp61.Util;

import android.content.ContentValues;

import com.example.myapp61.Mfragment.Home.XList;
import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;

/**
 * 参数解析
 */
public class ParameUtil {
    /**
     * 测试1号-------------转换为数组
     * @param j
     * @return
     * @throws JSONException
     */
    public static ArrayList<XList> test1(String j) throws JSONException {
        ArrayList<XList> arrayList =new ArrayList<XList>();
        Gson gson = new Gson();
        JSONArray arr = new JSONArray(j);
        for (int i = 0; i < arr.length(); i++) {
            XList l = gson.fromJson(arr.get(i).toString(),XList.class);
            arrayList.add(l);
        }
        return arrayList;
    }
}
